package com.daotu.psy.admin.controller.inner;

import com.daotu.psy.admin.api.dto.DeptUserCountDTO;
import com.daotu.psy.admin.api.entity.SysUser;
import com.daotu.psy.admin.service.SysDeptService;
import com.daotu.psy.admin.service.SysUserService;
import com.daotu.psy.common.security.annotation.Inner;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

/**
 * @author jacky
 * @date 2024-04-11
 */
@RestController
@AllArgsConstructor
@RequestMapping("/inner/depts")
public class InnerSysDeptController {

	private final SysDeptService sysDeptService;

	@Inner
	@GetMapping("/user-count")
	public List<DeptUserCountDTO> userCount(@RequestParam("deptIds")Set<Long> deptIds) {
		return sysDeptService.listUserCount(deptIds);
	}
}
